package cn.buglife.boot.consumer.service;

import cn.buglife.boot.consumer.bean.Bar;
import cn.buglife.boot.consumer.bean.Foo;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
public class Receiver {

    @RabbitListener(queues = "queue")
    public void receiveMessage(Foo foo) {
        System.out.println("Received <" + foo.getName() + ">");
    }

    @RabbitListener(queues = "queue")
    public void receiveMessage(Bar bar) {
        System.out.println("Received <" + bar.getAge() + ">");
    }
}
